﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Pear.Database.Migrations.Migrations
{
    public partial class Init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Article",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Title = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    Cover = table.Column<string>(type: "varchar(256) CHARACTER SET utf8mb4", maxLength: 256, nullable: true),
                    ArticleId = table.Column<int>(type: "int", nullable: false),
                    ArticleTypeName = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    ArticleStatus = table.Column<int>(type: "int", nullable: false),
                    Content = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", maxLength: 3000, nullable: false),
                    ReleaseTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    Sort = table.Column<int>(type: "int", nullable: false),
                    IsHot = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    PageView = table.Column<int>(type: "int", nullable: false),
                    GiveALikeCount = table.Column<int>(type: "int", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Article", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ArticleType",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    TypeName = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    Describe = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ArticleType", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "FriendLink",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    SiteName = table.Column<string>(type: "varchar(64) CHARACTER SET utf8mb4", maxLength: 64, nullable: false),
                    SiteDesc = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false),
                    Sort = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    WebSite = table.Column<string>(type: "varchar(256) CHARACTER SET utf8mb4", maxLength: 256, nullable: true),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FriendLink", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Role",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    Remark = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Role", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Security",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UniqueName = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
                    Remark = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Security", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SiteInfo",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Avatar = table.Column<string>(type: "varchar(256) CHARACTER SET utf8mb4", maxLength: 256, nullable: false),
                    Slogan = table.Column<string>(type: "varchar(128) CHARACTER SET utf8mb4", maxLength: 128, nullable: false),
                    Notice = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
                    NickName = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    Domain = table.Column<string>(type: "varchar(64) CHARACTER SET utf8mb4", maxLength: 64, nullable: true),
                    Describe = table.Column<string>(type: "varchar(256) CHARACTER SET utf8mb4", maxLength: 256, nullable: true),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SiteInfo", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SysMenu",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Pid = table.Column<long>(type: "bigint", nullable: false),
                    Pids = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
                    Name = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false),
                    Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
                    Type = table.Column<int>(type: "int", nullable: false),
                    Icon = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true),
                    Router = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
                    Component = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
                    Link = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
                    Redirect = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
                    Weight = table.Column<int>(type: "int", nullable: false),
                    Sort = table.Column<int>(type: "int", nullable: false),
                    Remark = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
                    Permission = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
                    Status = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysMenu", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SystemDataCategory",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    Remark = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
                    Sequence = table.Column<int>(type: "int", nullable: false),
                    HigherId = table.Column<int>(type: "int", nullable: true),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SystemDataCategory", x => x.Id);
                    table.ForeignKey(
                        name: "FK_SystemDataCategory_SystemDataCategory_HigherId",
                        column: x => x.HigherId,
                        principalTable: "SystemDataCategory",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateTable(
                name: "User",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Account = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    Password = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    Nickname = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: true),
                    Photo = table.Column<string>(type: "varchar(256) CHARACTER SET utf8mb4", maxLength: 256, nullable: true),
                    Synopsis = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
                    Gender = table.Column<int>(type: "int", nullable: false),
                    SigninedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_User", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "RoleSecurity",
                columns: table => new
                {
                    RoleId = table.Column<int>(type: "int", nullable: false),
                    SecurityId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RoleSecurity", x => new { x.RoleId, x.SecurityId });
                    table.ForeignKey(
                        name: "FK_RoleSecurity_Role_RoleId",
                        column: x => x.RoleId,
                        principalTable: "Role",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_RoleSecurity_Security_SecurityId",
                        column: x => x.SecurityId,
                        principalTable: "Security",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateTable(
                name: "SysRoleMenu",
                columns: table => new
                {
                    SysRoleId = table.Column<int>(type: "int", nullable: false),
                    SysMenuId = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysRoleMenu", x => new { x.SysRoleId, x.SysMenuId });
                    table.ForeignKey(
                        name: "FK_SysRoleMenu_Role_SysRoleId",
                        column: x => x.SysRoleId,
                        principalTable: "Role",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_SysRoleMenu_SysMenu_SysMenuId",
                        column: x => x.SysMenuId,
                        principalTable: "SysMenu",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateTable(
                name: "SystemData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: false),
                    Remark = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
                    Sequence = table.Column<int>(type: "int", nullable: false),
                    CategoryId = table.Column<int>(type: "int", nullable: false),
                    Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SystemData", x => x.Id);
                    table.ForeignKey(
                        name: "FK_SystemData_SystemDataCategory_CategoryId",
                        column: x => x.CategoryId,
                        principalTable: "SystemDataCategory",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateTable(
                name: "SocialInfo",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Title = table.Column<string>(type: "varchar(64) CHARACTER SET utf8mb4", maxLength: 64, nullable: false),
                    Icon = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: true),
                    Color = table.Column<string>(type: "varchar(32) CHARACTER SET utf8mb4", maxLength: 32, nullable: true),
                    Href = table.Column<string>(type: "varchar(128) CHARACTER SET utf8mb4", maxLength: 128, nullable: true),
                    UserId = table.Column<int>(type: "int", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SocialInfo", x => x.Id);
                    table.ForeignKey(
                        name: "FK_SocialInfo_User_UserId",
                        column: x => x.UserId,
                        principalTable: "User",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateTable(
                name: "UserRole",
                columns: table => new
                {
                    UserId = table.Column<int>(type: "int", nullable: false),
                    RoleId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserRole", x => new { x.UserId, x.RoleId });
                    table.ForeignKey(
                        name: "FK_UserRole_Role_RoleId",
                        column: x => x.RoleId,
                        principalTable: "Role",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_UserRole_User_UserId",
                        column: x => x.UserId,
                        principalTable: "User",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.InsertData(
                table: "ArticleType",
                columns: new[] { "Id", "CreatedTime", "Describe", "IsDeleted", "TypeName", "UpdatedTime" },
                values: new object[,]
                {
                    { 1, new DateTimeOffset(new DateTime(2021, 4, 27, 18, 3, 41, 306, DateTimeKind.Unspecified).AddTicks(2691), new TimeSpan(0, 8, 0, 0, 0)), "简单说明 无意义！！！", false, ".NET Core", null },
                    { 2, new DateTimeOffset(new DateTime(2021, 4, 27, 18, 3, 41, 309, DateTimeKind.Unspecified).AddTicks(8488), new TimeSpan(0, 8, 0, 0, 0)), "简单说明 无意义！！！", false, "Docker", null },
                    { 3, new DateTimeOffset(new DateTime(2021, 4, 27, 18, 3, 41, 309, DateTimeKind.Unspecified).AddTicks(8552), new TimeSpan(0, 8, 0, 0, 0)), "简单说明 无意义！！！", false, "My Sql", null },
                    { 4, new DateTimeOffset(new DateTime(2021, 4, 27, 18, 3, 41, 309, DateTimeKind.Unspecified).AddTicks(8555), new TimeSpan(0, 8, 0, 0, 0)), "简单说明 无意义！！！", false, "个性随笔", null }
                });

            migrationBuilder.InsertData(
                table: "Role",
                columns: new[] { "Id", "CreatedTime", "Enabled", "IsDeleted", "Name", "Remark", "UpdatedTime" },
                values: new object[,]
                {
                    { 1, new DateTimeOffset(new DateTime(2020, 12, 17, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "超级管理员", "拥有所有权限", null },
                    { 2, new DateTimeOffset(new DateTime(2020, 12, 17, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "测试用户", "只有测试权限", null }
                });

            migrationBuilder.InsertData(
                table: "Security",
                columns: new[] { "Id", "CreatedTime", "Enabled", "IsDeleted", "Remark", "UniqueName", "UpdatedTime" },
                values: new object[,]
                {
                    { 22, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "security.service.QaQ", "security.service.QaQ", null },
                    { 21, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "security.service.all", "security.service.all", null },
                    { 20, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "security.service.refresh", "security.service.refresh", null },
                    { 19, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "security.service.give", "security.service.give", null },
                    { 18, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "security.service.list", "security.service.list", null },
                    { 17, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "role.service.give", "role.service.give", null },
                    { 15, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "role.service.modify", "role.service.modify", null },
                    { 14, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "role.service.add", "role.service.add", null },
                    { 13, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "role.service.list", "role.service.list", null },
                    { 12, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.securities", "user.service.securities", null },
                    { 16, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "role.service.delete", "role.service.delete", null },
                    { 10, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.roles", "user.service.roles", null },
                    { 11, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.securities.self", "user.service.securities.self", null },
                    { 1, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.profile.self", "user.service.profile.self", null },
                    { 2, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.profile", "user.service.profile", null },
                    { 4, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.modify.self", "user.service.modify.self", null },
                    { 5, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.modify", "user.service.modify", null },
                    { 3, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.list", "user.service.list", null },
                    { 7, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.add", "user.service.add", null },
                    { 8, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.change.password", "user.service.change.password", null },
                    { 9, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.roles.self", "user.service.roles.self", null },
                    { 6, new DateTimeOffset(new DateTime(2020, 12, 22, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "user.service.delete", "user.service.delete", null }
                });

            migrationBuilder.InsertData(
                table: "SiteInfo",
                columns: new[] { "Id", "Avatar", "CreatedTime", "Describe", "Domain", "IsDeleted", "NickName", "Notice", "Slogan", "UpdatedTime" },
                values: new object[] { 1, "https://thirdqq.qlogo.cn/g?b=sdk&k=Z1t6YCakOQ2Q3MQOficzY3g&s=640&t=1613218953", new DateTimeOffset(new DateTime(2021, 4, 27, 18, 3, 41, 315, DateTimeKind.Unspecified).AddTicks(8338), new TimeSpan(0, 8, 0, 0, 0)), "一个.NET开发者苦逼记录！", "Https://www.yxsaid.com", false, "奕轩", "足够优秀，再大方拥有！", "冰冻三尺，非一日之寒！", null });

            migrationBuilder.InsertData(
                table: "SysMenu",
                columns: new[] { "Id", "Code", "Component", "CreatedTime", "Icon", "IsDeleted", "Link", "Name", "Permission", "Pid", "Pids", "Redirect", "Remark", "Router", "Sort", "Status", "Type", "UpdatedTime", "Weight" },
                values: new object[,]
                {
                    { 142307070910580L, "sys_user_mgr_reset_pwd", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户重置密码", "sysUser:resetPwd", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914653L, "sys_role_mgr_add", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色增加", "sysRole:add", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070918777L, "sys_user_mgr_login", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户登录信息", "getLoginUser", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, false, 2, null, 1 },
                    { 142307070914651L, "sys_role_mgr", "system/role/index", new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色管理", null, 142307070910563L, "[0],[142307070910563],", null, null, "/role", 100, true, 1, null, 1 },
                    { 142307070914652L, "sys_role_mgr_page", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色查询", "sysRole:page", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914654L, "sys_role_mgr_edit", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色编辑", "sysRole:edit", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914660L, "sys_role_mgr_grant_data", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色授权数据", "sysRole:grantData", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914656L, "sys_role_mgr_detail", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色详情", "sysRole:detail", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914657L, "sys_role_mgr_drop_down", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色下拉", "sysRole:dropDown", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914658L, "sys_role_mgr_grant_menu", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色授权菜单", "sysRole:grantMenu", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914659L, "sys_role_mgr_own_menu", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色拥有菜单", "sysRole:ownMenu", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914661L, "sys_role_mgr_own_data", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色拥有数据", "sysRole:ownData", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910579L, "sys_user_mgr_update_avatar", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户修改头像", "sysUser:updateAvatar", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070914655L, "sys_role_mgr_delete", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "角色删除", "sysRole:delete", 142307070914651L, "[0],[142307070910563],[142307070914651],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910578L, "sys_user_mgr_change_status", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户修改状态", "sysUser:changeStatus", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910564L, "sys_user_mgr", "system/user/index", new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户管理", null, 142307070910563L, "[0],[142307070910563],", null, null, "/mgr_user", 100, true, 1, null, 1 },
                    { 142307070910576L, "sys_user_mgr_update_info", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户更新信息", "sysUser:updateInfo", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910575L, "sys_user_mgr_own_data", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户拥有数据", "sysUser:ownData", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910574L, "sys_user_mgr_grant_data", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户授权数据", "sysUser:grantData", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910573L, "sys_user_mgr_own_role", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户拥有角色", "sysUser:ownRole", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910572L, "sys_user_mgr_grant_role", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户授权角色", "sysUser:grantRole", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910571L, "sys_user_mgr_selector", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户选择器", "sysUser:selector", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910570L, "sys_user_mgr_export", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户导出", "sysUser:export", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910569L, "sys_user_mgr_detail", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户详情", "sysUser:detail", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910568L, "sys_user_mgr_delete", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户删除", "sysUser:delete", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910567L, "sys_user_mgr_add", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户增加", "sysUser:add", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910566L, "sys_user_mgr_edit", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户编辑", "sysUser:edit", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910565L, "sys_user_mgr_page", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户查询", "sysUser:page", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 },
                    { 142307070910563L, "auth_manager", "PageView", new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), "safety-certificate", false, null, "权限管理", null, 0L, "[0],", null, null, "/auth", 100, true, 0, null, 1 },
                    { 142307070910577L, "sys_user_mgr_update_pwd", null, new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, false, null, "用户修改密码", "sysUser:updatePwd", 142307070910564L, "[0],[142307070910563],[142307070910564],", null, null, null, 100, true, 2, null, 1 }
                });

            migrationBuilder.InsertData(
                table: "SystemDataCategory",
                columns: new[] { "Id", "CreatedTime", "Enabled", "HigherId", "IsDeleted", "Name", "Remark", "Sequence", "UpdatedTime" },
                values: new object[] { 1, new DateTimeOffset(new DateTime(2020, 12, 22, 15, 30, 20, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, null, false, "性别", "性别", 0, null });

            migrationBuilder.InsertData(
                table: "User",
                columns: new[] { "Id", "Account", "CreatedTime", "Enabled", "Gender", "IsDeleted", "Nickname", "Password", "Photo", "SigninedTime", "Synopsis", "UpdatedTime" },
                values: new object[] { 1, "admin", new DateTimeOffset(new DateTime(2020, 12, 17, 10, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, 0, false, null, "21232f297a57a5a743894a0e4a801fc3", null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null });

            migrationBuilder.InsertData(
                table: "RoleSecurity",
                columns: new[] { "RoleId", "SecurityId" },
                values: new object[,]
                {
                    { 1, 1 },
                    { 1, 21 },
                    { 1, 20 },
                    { 1, 19 },
                    { 1, 18 },
                    { 1, 17 },
                    { 1, 16 },
                    { 1, 15 },
                    { 1, 13 },
                    { 1, 12 },
                    { 1, 14 },
                    { 1, 10 },
                    { 1, 9 },
                    { 1, 8 },
                    { 1, 7 },
                    { 1, 6 },
                    { 1, 5 },
                    { 1, 4 },
                    { 1, 3 },
                    { 1, 2 },
                    { 1, 11 }
                });

            migrationBuilder.InsertData(
                table: "SocialInfo",
                columns: new[] { "Id", "Color", "CreatedTime", "Href", "Icon", "IsDeleted", "Title", "UpdatedTime", "UserId" },
                values: new object[,]
                {
                    { 3, "#1AB6FF", new DateTimeOffset(new DateTime(2021, 4, 27, 18, 3, 41, 492, DateTimeKind.Unspecified).AddTicks(5159), new TimeSpan(0, 8, 0, 0, 0)), "http://wpa.qq.com/msgrd?v=3&uin=1518648489&site=qq&menu=yes", "iconqq", false, "QQ", null, 1 },
                    { 1, "#d81e06", new DateTimeOffset(new DateTime(2021, 4, 27, 18, 3, 41, 492, DateTimeKind.Unspecified).AddTicks(2728), new TimeSpan(0, 8, 0, 0, 0)), "https://gitee.com/YxCool", "icongitee", false, "Gitee", null, 1 },
                    { 2, "red", new DateTimeOffset(new DateTime(2021, 4, 27, 18, 3, 41, 492, DateTimeKind.Unspecified).AddTicks(5140), new TimeSpan(0, 8, 0, 0, 0)), "https://github.com/1518648489", "icongithub", false, "GitHub", null, 1 }
                });

            migrationBuilder.InsertData(
                table: "SystemData",
                columns: new[] { "Id", "CategoryId", "CreatedTime", "Enabled", "IsDeleted", "Name", "Remark", "Sequence", "UpdatedTime" },
                values: new object[,]
                {
                    { 1, 1, new DateTimeOffset(new DateTime(2020, 12, 22, 15, 30, 20, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "男", "男", 0, null },
                    { 2, 1, new DateTimeOffset(new DateTime(2020, 12, 22, 15, 30, 20, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), true, false, "女", "女", 1, null }
                });

            migrationBuilder.InsertData(
                table: "UserRole",
                columns: new[] { "RoleId", "UserId" },
                values: new object[] { 1, 1 });

            migrationBuilder.CreateIndex(
                name: "IX_RoleSecurity_SecurityId",
                table: "RoleSecurity",
                column: "SecurityId");

            migrationBuilder.CreateIndex(
                name: "IX_SocialInfo_UserId",
                table: "SocialInfo",
                column: "UserId");

            migrationBuilder.CreateIndex(
                name: "IX_SysRoleMenu_SysMenuId",
                table: "SysRoleMenu",
                column: "SysMenuId");

            migrationBuilder.CreateIndex(
                name: "IX_SystemData_CategoryId",
                table: "SystemData",
                column: "CategoryId");

            migrationBuilder.CreateIndex(
                name: "IX_SystemDataCategory_HigherId",
                table: "SystemDataCategory",
                column: "HigherId");

            migrationBuilder.CreateIndex(
                name: "IX_UserRole_RoleId",
                table: "UserRole",
                column: "RoleId");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Article");

            migrationBuilder.DropTable(
                name: "ArticleType");

            migrationBuilder.DropTable(
                name: "FriendLink");

            migrationBuilder.DropTable(
                name: "RoleSecurity");

            migrationBuilder.DropTable(
                name: "SiteInfo");

            migrationBuilder.DropTable(
                name: "SocialInfo");

            migrationBuilder.DropTable(
                name: "SysRoleMenu");

            migrationBuilder.DropTable(
                name: "SystemData");

            migrationBuilder.DropTable(
                name: "UserRole");

            migrationBuilder.DropTable(
                name: "Security");

            migrationBuilder.DropTable(
                name: "SysMenu");

            migrationBuilder.DropTable(
                name: "SystemDataCategory");

            migrationBuilder.DropTable(
                name: "Role");

            migrationBuilder.DropTable(
                name: "User");
        }
    }
}
